package com.xoa.model.timedTask;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * 任务实体类
 */
public class TimedTask {
    /**
     * 任务ID
     */
    private Integer taskId;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 任务描述
     */
    private String taskDescription;

    /**
     * 任务类型
     */
    private String taskType;

    /**
     * 是否同步
     */
    private String syncYn;

    /**
     * 任务状态
     */
    private String status;

    /**
     * 任务失败后是否继续执行下一次
     */
    private String errContinueYn;

    /**
     * 执行间隔时间（天，周（1-7），月）
     */
    private Integer intervalTime;

    /**
     * 执行间隔类型 间隔类型（间隔执行：0-分钟，1-小时）（定点执行：2-天，3-周，4-月）
     */
    private String intervalType;

    /**
     * 执行时间(执行日期（定点按月执行时生效 1-31）)
     */
    private Integer executionDate;

    /**
     * 执行时间
     */
    @DateTimeFormat(pattern = "HH:mm:ss")
    @JSONField(format = "HH:mm:ss")
    private Date executionTime;

    /**
     * cron 表达式
     */
    private String cron;

    /**
     * cron 表达式转化汉字
     */
    private String cronStr;

    /**
     * 执行类
     */
    private String classPath;

    /**
     * 执行方法
     */
    private String methodName;

    /**
     * 最后一次执行时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date lastTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    List<TimedTaskRecord> timedTaskRecords;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.TASK_ID
     *
     * @return the value of timed_task.TASK_ID
     *
     * @mbggenerated
     */
    public Integer getTaskId() {
        return taskId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.TASK_ID
     *
     * @param taskId the value for timed_task.TASK_ID
     *
     * @mbggenerated
     */
    public void setTaskId(Integer taskId) {
        this.taskId = taskId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.TASK_NAME
     *
     * @return the value of timed_task.TASK_NAME
     *
     * @mbggenerated
     */
    public String getTaskName() {
        return taskName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.TASK_NAME
     *
     * @param taskName the value for timed_task.TASK_NAME
     *
     * @mbggenerated
     */
    public void setTaskName(String taskName) {
        this.taskName = taskName == null ? null : taskName.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.TASK_DESCRIPTION
     *
     * @return the value of timed_task.TASK_DESCRIPTION
     *
     * @mbggenerated
     */
    public String getTaskDescription() {
        return taskDescription;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.TASK_DESCRIPTION
     *
     * @param taskDescription the value for timed_task.TASK_DESCRIPTION
     *
     * @mbggenerated
     */
    public void setTaskDescription(String taskDescription) {
        this.taskDescription = taskDescription == null ? null : taskDescription.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.TASK_TYPE
     *
     * @return the value of timed_task.TASK_TYPE
     *
     * @mbggenerated
     */
    public String getTaskType() {
        return taskType;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.TASK_TYPE
     *
     * @param taskType the value for timed_task.TASK_TYPE
     *
     * @mbggenerated
     */
    public void setTaskType(String taskType) {
        this.taskType = taskType == null ? null : taskType.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.SYNC_YN
     *
     * @return the value of timed_task.SYNC_YN
     *
     * @mbggenerated
     */
    public String getSyncYn() {
        return syncYn;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.SYNC_YN
     *
     * @param syncYn the value for timed_task.SYNC_YN
     *
     * @mbggenerated
     */
    public void setSyncYn(String syncYn) {
        this.syncYn = syncYn == null ? null : syncYn.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.STATUS
     *
     * @return the value of timed_task.STATUS
     *
     * @mbggenerated
     */
    public String getStatus() {
        return status;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.STATUS
     *
     * @param status the value for timed_task.STATUS
     *
     * @mbggenerated
     */
    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public String getErrContinueYn() {
        return errContinueYn;
    }

    public void setErrContinueYn(String errContinueYn) {
        this.errContinueYn = errContinueYn;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.INTERVAL_TIME
     *
     * @return the value of timed_task.INTERVAL_TIME
     *
     * @mbggenerated
     */
    public Integer getIntervalTime() {
        return intervalTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.INTERVAL_TIME
     *
     * @param intervalTime the value for timed_task.INTERVAL_TIME
     *
     * @mbggenerated
     */
    public void setIntervalTime(Integer intervalTime) {
        this.intervalTime = intervalTime;
    }

    public String getIntervalType() {
        return intervalType;
    }

    public void setIntervalType(String intervalType) {
        this.intervalType = intervalType;
    }

    public Integer getExecutionDate() {
        return executionDate;
    }

    public void setExecutionDate(Integer executionDate) {
        this.executionDate = executionDate;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.EXECUTION_TIME
     *
     * @return the value of timed_task.EXECUTION_TIME
     *
     * @mbggenerated
     */
    public Date getExecutionTime() {
        return executionTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.EXECUTION_TIME
     *
     * @param executionTime the value for timed_task.EXECUTION_TIME
     *
     * @mbggenerated
     */
    public void setExecutionTime(Date executionTime) {
        this.executionTime = executionTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.CRON
     *
     * @return the value of timed_task.CRON
     *
     * @mbggenerated
     */
    public String getCron() {
        return cron;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.CRON
     *
     * @param cron the value for timed_task.CRON
     *
     * @mbggenerated
     */
    public void setCron(String cron) {
        this.cron = cron == null ? null : cron.trim();
    }

    public String getCronStr() {
        return cronStr;
    }

    public void setCronStr(String cronStr) {
        this.cronStr = cronStr;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.CLASS_PATH
     *
     * @return the value of timed_task.CLASS_PATH
     *
     * @mbggenerated
     */
    public String getClassPath() {
        return classPath;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.CLASS_PATH
     *
     * @param classPath the value for timed_task.CLASS_PATH
     *
     * @mbggenerated
     */
    public void setClassPath(String classPath) {
        this.classPath = classPath == null ? null : classPath.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.METHOD_NAME
     *
     * @return the value of timed_task.METHOD_NAME
     *
     * @mbggenerated
     */
    public String getMethodName() {
        return methodName;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.METHOD_NAME
     *
     * @param methodName the value for timed_task.METHOD_NAME
     *
     * @mbggenerated
     */
    public void setMethodName(String methodName) {
        this.methodName = methodName == null ? null : methodName.trim();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.LAST_TIME
     *
     * @return the value of timed_task.LAST_TIME
     *
     * @mbggenerated
     */
    public Date getLastTime() {
        return lastTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.LAST_TIME
     *
     * @param lastTime the value for timed_task.LAST_TIME
     *
     * @mbggenerated
     */
    public void setLastTime(Date lastTime) {
        this.lastTime = lastTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column timed_task.UPDATE_TIME
     *
     * @return the value of timed_task.UPDATE_TIME
     *
     * @mbggenerated
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column timed_task.UPDATE_TIME
     *
     * @param updateTime the value for timed_task.UPDATE_TIME
     *
     * @mbggenerated
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public List<TimedTaskRecord> getTimedTaskRecords() {
        return timedTaskRecords;
    }

    public void setTimedTaskRecords(List<TimedTaskRecord> timedTaskRecords) {
        this.timedTaskRecords = timedTaskRecords;
    }
}